<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2>Ajax的跨域访问</h2>
    <button>发送Ajax请求</button>
    <br/><br/>
    <div id="did"></div>
    
    <script>
        // // 获取上面button按钮并绑定点击事件
        const bn = document.querySelector("button");
        bn.onclick = function(){
           const script =  document.createElement("script");
           script.setAttribute("src","http://localhost:3000/test09");
           document.querySelector("body").appendChild(script);
        }

        
        function abc(info){
            alert(info);
        }

    </script>
    <!-- <script src="http://localhost:3000/js/my.js">
        abc("Hello Ajax!")
    </script> -->
    <!-- <script src="http://localhost:3000/test09"></script> -->
</body>
</html>
